Switch build-time tests and autopkgtests to Python 3
authorSimon McVittie <smcv@debian.org>
Wed, 17 Jan 2018 14:08:41 +0000 (14:08 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 17 Jan 2018 15:28:04 +0000 (15:28 +0000)
debian/control
debian/patches/debian/Use-Python-3-for-tests.patch [new file with mode: 0644]
debian/patches/series

index 1ee14c20caffa69b98533a7d985e6b8e8ffcc18f..057f92529bd5248e0779e76b828affe8138f61aa 100644 (file)
@@ -36,8 +36,8 @@ Build-Depends:
  libsystemd-dev,
  libtool,
  procps,
- python <!nocheck>,
- python-yaml <!nocheck>,
+ python3 <!nocheck>,
+ python3-yaml <!nocheck>,
  xsltproc <!nodoc>,
  zlib1g-dev,
 Build-Depends-Indep:
@@ -155,8 +155,8 @@ Depends:
  gir1.2-ostree-1.0,
  gjs [!sparc64],
  ostree,
- python,
- python-yaml,
+ python3,
+ python3-yaml,
  ${misc:Depends},
  ${shlibs:Depends},
 Description: content-addressed filesystem for operating system binaries - tests
diff --git a/debian/patches/debian/Use-Python-3-for-tests.patch b/debian/patches/debian/Use-Python-3-for-tests.patch
new file mode 100644 (file)
index 0000000..9062dce
--- /dev/null
@@ -0,0 +1,45 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Wed, 17 Jan 2018 14:07:32 +0000
+Subject: Use Python 3 for tests
+
+Forwarded: not-needed
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ tests/bootloader-entries-crosscheck.py | 2 +-
+ tests/test-basic-user-only.sh          | 2 +-
+ tests/test-concurrency.py              | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/bootloader-entries-crosscheck.py b/tests/bootloader-entries-crosscheck.py
+index 5faa548..41f6956 100755
+--- a/tests/bootloader-entries-crosscheck.py
++++ b/tests/bootloader-entries-crosscheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ #
+ # Copyright (C) 2015 Red Hat
+ #
+diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh
+index 6a2ca25..662d32f 100755
+--- a/tests/test-basic-user-only.sh
++++ b/tests/test-basic-user-only.sh
+@@ -26,7 +26,7 @@ extra_basic_tests=5
+ . $(dirname $0)/basic-test.sh
+ $CMD_PREFIX ostree --version > version.yaml
+-python -c 'import yaml; yaml.safe_load(open("version.yaml"))'
++python3 -c 'import yaml; yaml.safe_load(open("version.yaml"))'
+ echo "ok yaml version"
+ # Reset things so we don't inherit a lot of state from earlier tests
+diff --git a/tests/test-concurrency.py b/tests/test-concurrency.py
+index 3a0ce10..3ec3681 100755
+--- a/tests/test-concurrency.py
++++ b/tests/test-concurrency.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (C) 2017 Colin Walters <walters@verbum.org>
+ #
index 0ca7fd7fe63394577dc0c920506dc9ad181b40b1..066a53d7699cd1ab4a577dcb12fcf234696e9e7c 100644 (file)
@@ -2,3 +2,4 @@ test-concurrency-Use-Python-3-syntax-for-octal.patch
 test-concurrency-Replace-range-with-xrange.patch
 test-concurrency-Explicitly-use-floor-division.patch
 tests-bootloader-entries-crosscheck-Use-Python-3-friendly.patch
+debian/Use-Python-3-for-tests.patch